import { useRef } from "react";

const App = () => {
  let dom = useRef()
  const btn = () => {
    dom.current.style.color = 'red'
    console.log(dom.current.style.color);
  }
  return (
    <>
      <h1 ref={dom}>App</h1>
      <button onClick={btn}>点击</button>
    </>
  )
}

export default App
